<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of FormaPagoForm
 *
 * @author maxi
 */
class FormaPagoForm extends BaseVentasForm {

    public function configure() {
        //$this->getWidget('tarjeta_cuotas')->attributesToHtml(array('size'=>'5'));
        //$this->widgetSchema['efectivo_importe']->setAttribute('size','5');
        //$this->widgetSchema['tarjeta_cuotas']->addOption('size','5');
        //$this->widgetSchema['cheque_importe']->setAttribute('size','5');
    }

    public function setup() {

        

        $this->setWidgets(array(
            'efectivo' => new sfWidgetFormInputCheckbox(array('label' => 'Efectivo')),
            'efectivo_importe' => new sfWidgetFormInput(array('label' => '$')),
            'cheque' => new sfWidgetFormInputCheckbox(array('label' => 'Cheque')),
            'cheque_importe' => new sfWidgetFormInput(array('label' => '$')),
            'cta_cte' => new sfWidgetFormInputCheckbox(array('label' => 'Cta Cte')),
            'cta_cte_importe' => new sfWidgetFormInput(array('label' => '$')),
            'tarjeta' => new sfWidgetFormInputCheckbox(array('label' => 'Tarjeta')),
            'tarjeta_cuotas' => new sfWidgetFormInput(array('label' => 'Cuotas')),
            'tarjeta_importe' => new sfWidgetFormInput(array('label' => '$')),
        ));

        $this->setValidators(array(
            'efectivo' => new sfValidatorChoice(array('choices' => array(0,"on"),'required' => false)),
            'efectivo_importe' => new sfValidatorNumber(array('min' => 0,'required' => false)),
            'cheque' => new sfValidatorChoice(array('choices' => array(0,"on"),'required' => false)),
            'cheque_importe' => new sfValidatorNumber(array('min' => 0,'required' => false)),
            'cta_cte' => new sfValidatorChoice(array('choices' => array(0,"on"),'required' => false)),
            'cta_cte_importe' =>new sfValidatorNumber(array('min' => 0,'required' => false)),
            'tarjeta' => new sfValidatorChoice(array('choices' => array(0,"on"),'required' => false)),
            'tarjeta_cuotas' => new sfValidatorInteger(array('min' => 0,'required' => false)),
            'tarjeta_importe' => new sfValidatorNumber(array('min' => 0,'required' => false)),
        ));
    }

}

?>
